import request from '@/utils/request'

export function getList(params) {
  return request({
    url: '/enterprise/list',
    method: 'post',
    data: params
  })
}
export function getInfoById(params) {
  return request({
    url: '/enterprise/getinfo',
    method: 'post',
    data: { eid: params }
  })
}
export function uploadData(params) {
  return request({
    url: '/enterprise/updateoradd',
    method: 'post',
    data: params
  })
}
export function deleteData(params) {
  const id = params.map((num) => { return num.id })
  return request({
    url: '/enterprise/delete/',
    method: 'post',
    data: { eid: id }
  })
}
export function setPass(params) {
  const id = params.obj.map((num) => { return num.id })
  return request({
    url: '/enterprise/examine',
    method: 'post',
    data: { eid: id, examine: params.examine }
  })
}
export function uploadImage(Data) {
  return request({
    headers: {
      Authorization: 'Yb7WLn0LX60axwxnDbxSqSC8qKlYMmdm',
      'Content-Type': 'multipart/form-data'
    },
    url: 'https://sm.ms/api/v2/upload',
    method: 'post',
    data: { smfile: Data }
  })
}
export function newData(params) {
  // const body = params.data
  return request({
    url: '/enterprise/updateoradd',
    method: 'post',
    data: params
  })
}
